module chapter3;

#include <concepts>
#include <iostream>

using namespace std;

namespace chapter3{
    namespace section2{
        bool is2multiple(long long int x){
            if (x%2==0){
                return true;
            }
            return false;
        }

        float with_luggage(int lugg){
            /**
             * The fee is 1.68 yuan per kilogram of luggage,
             * and if it is more than 20 kilograms,
             * it will be charged 1.98 yuan per kilogram
             * */

            if (lugg > 20){
                return (float)lugg*1.98;
            } else {
                return lugg * 1.68;
            }
        }

        long long int find_maximal(int a, int b, int c){
            if(a>=b&&a>=c) return a;
            else if (b>=a&&b>=c) return b;
            else return c;
        }

        long long int find_maximal2(int a, int b, int c){
            return (a>=b&&a>=c)?a:(b>=a&&b>=c)?b:c;
        }
    }

    namespace section3{
        void what_weekday(int x){
            switch(x){
                case 1:cout<<"Monday"<<endl;    break;
                case 2:cout<<"Tuesday"<<endl;   break;
                case 3:cout<<"Wenesday"<<endl;  break;
                case 4:cout<<"Thursday"<<endl;  break;
                case 5:cout<<"Friday"<<endl;    break;
                case 6:cout<<"Saturday"<<endl;  break;
                case 7:cout<<"Sunday"<<endl;    break;
                default: throw std::bad_exception();
            }
            return;
        }
    }
}
